;
layui.define(['table', 'form'], function (exports) {
    var $ = layui.$,
        table = layui.table,
        form = layui.form;

    table.render({
        elem: '#instancesTable'
        , url: '/instances/list' //模拟接口
        , cols: [[
            {field: 'id', hide: true, title: 'ID'},
            , {field: 'master_name', width: 135, title: 'master名称'}
            , {field: 'init_num', title: '初始化次数', minWidth: 100}
            , {field: 'yun_platform', title: '云平台名称', minWidth: 100}
            , {field: 'local_name', title: '区域名称', minWidth: 100}
            , {field: 'instance_name', title: 'ecs名称', minWidth: 100}
            , {field: 'instance_name', title: '心跳上报频率', minWidth: 100}
            , {field: 'bind_live', title: '监听超时时间', minWidth: 100}
            , {field: 'edit_time', title: '更新时间', minWidth: 100}
        ]]
        , page: true
        , limit: 30
        , height: 'full-220'
        , text: {
            none: '暂无相关数据' //默认：无数据。注：该属性为 layui 2.2.5 开始新增
        }
    });

    //监听搜索
    form.on('submit(LAY-user-front-search)', function (data) {
        var field = data.field;
        //执行重载
        table.reload('instancesTable', {
            where: field
        });
    });
    //对外输出
    exports('instances', {});
});
